#pragma once
#include <pthread.h>

#include "currentThread.h"

#include <unistd.h>
#include <syscall.h>

// 获取每一个线程的tid
namespace TinyRPC{

    thread_local pid_t tid = 0;
    
    pid_t CurrentThread::Tid(){
        if(tid == 0){
            tid = syscall(SYS_gettid);
        }
        return tid;
    }
    
}
